import { Button } from 'cc';
import { EventName } from '../consts/events';
import Utils from '../utils';
import { UiBasic } from './basic';

// 游戏开始界面
export class UiStart extends UiBasic {
    protected onLoad(): void {
        const startBtn = this.node.getChildByPath('StartButton');
        startBtn.on(Button.EventType.CLICK, this.startGame, this);
        this.node.setPosition(0, 0);
    }
    private startGame() {
        Utils.events.emit(EventName.StartGame);
    }
}
